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