UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8k9dMY9MB2xMP2iQcvJMeLV6zVAv/mf/Vg98OXxHQRA=' 
WHERE 
  key_id = '5e33740fb30b05c5baa174047a89bd74b76bc345dabcc45803f07c0c217a6a12' 
  AND (
    token = '8k9dMY9MB2xMP2iQcvJMeLV6zVAv/mf/Vg98OXxHQRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023