UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zmmdTWkKZtCeBZsekVYyQnZbcjVFp6HRMwQZFbERpvw=' 
WHERE 
  key_id = 'cddef4b48673e7472bb679f70b05da7c73c50a2d0ddb5b2ef4b46e7b9ab00ad7' 
  AND (
    token = 'zmmdTWkKZtCeBZsekVYyQnZbcjVFp6HRMwQZFbERpvw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019