UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hOjx3J4rafp0yEfSvXjjMdR/GOaydlxkA0ZAM7+Kvvs=' 
WHERE 
  key_id = '59555afee5d38a7dffe2f48452a6feb25ca7307584b74d728dc13c7fe06c5032' 
  AND (
    token = 'hOjx3J4rafp0yEfSvXjjMdR/GOaydlxkA0ZAM7+Kvvs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033