UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qd1A3RL6uIFaIdev9qqGIbGR6j+jUQQ/BFxGdAv2Ung=' 
WHERE 
  key_id = '922259caeb50bb80c1ce7899ed6b137c60bab43947a9ee276e1b60d625780f65' 
  AND (
    token = 'Qd1A3RL6uIFaIdev9qqGIbGR6j+jUQQ/BFxGdAv2Ung=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049