UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PakLhQilRVulFdJmYchqeA+W8KN11X3uou9y4nh6ZVc=' 
WHERE 
  key_id = 'aece7a1e3370e57ba4978f9c5615257e8dd643017f291d966561bf6ea002a795' 
  AND (
    token = 'PakLhQilRVulFdJmYchqeA+W8KN11X3uou9y4nh6ZVc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029