UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nrC0yk3Cw2O1SD7ET3Upusy5SEyxEHnTn0GpzcBhZqk=' 
WHERE 
  key_id = 'ed7c37b0d75f13f53a338e44f16c1c625b88cbb1bf04c14d93b7480df9c4c3e7' 
  AND (
    token = 'nrC0yk3Cw2O1SD7ET3Upusy5SEyxEHnTn0GpzcBhZqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028