UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K4CLtaIboDqdp91ht3RZFEt36Dh/eA9EYmFZcwr/aw0=' 
WHERE 
  key_id = '4074e49d0dd618f7ec815788b6e257deffcc5bdfc4544e5fd5cbfecde756585c' 
  AND (
    token = 'K4CLtaIboDqdp91ht3RZFEt36Dh/eA9EYmFZcwr/aw0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025