UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IhnFVoIWi6uarNw5ki+TjQ4A5mU6gpsV07Kra0Dr5FI=' 
WHERE 
  key_id = 'eba733a83c65d1263da72a95495d32a8253d0a414bef8c8b64b5473932867aa9' 
  AND (
    token = 'IhnFVoIWi6uarNw5ki+TjQ4A5mU6gpsV07Kra0Dr5FI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043