UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u+P1Ei1im78TGQzkMF+EQN+DD0TWHARXqK1H9ytZ+FQ=' 
WHERE 
  key_id = 'e1a48099741aaa836870e239c03d2a45554e8dd9d2b25f59df96d05119e70821' 
  AND (
    token = 'u+P1Ei1im78TGQzkMF+EQN+DD0TWHARXqK1H9ytZ+FQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060