UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pdCcJbV3XoMHWL42EQSP6uXk/UbrKGp0F0yB9vfPca4=' 
WHERE 
  key_id = '262168a480f116522b695d696254471178f5194de02e34262fc11444b55ae719' 
  AND (
    token = 'pdCcJbV3XoMHWL42EQSP6uXk/UbrKGp0F0yB9vfPca4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032