UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YAmUZO3culdznEPjBcTWF8a19l7DkijWVRURyi6cqdk=' 
WHERE 
  key_id = '17e559b16ce9ef0a18f918192e9cff562cb91af8901e74c8e86191bab39aa3bc' 
  AND (
    token = 'YAmUZO3culdznEPjBcTWF8a19l7DkijWVRURyi6cqdk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040