UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TX7rH0CwODgAmOAN2/uJ0tmL3hJFXkPkG9uZigYEpgQ=' 
WHERE 
  key_id = '4c7080da01e04c28473f201e3e1afc695cb57cf512ab448c70951926c8cf39b3' 
  AND (
    token = 'TX7rH0CwODgAmOAN2/uJ0tmL3hJFXkPkG9uZigYEpgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031