UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bQ+z0OHtFjw1NwDUYub4PmMYVPJqeBVV0B/hktpFtk0='
WHERE
key_id = 'cf72b67646d605ad6e6ceee0e9223733dbe03fb811c5934a551fe5ccf8d51da6'
AND (
token = 'bQ+z0OHtFjw1NwDUYub4PmMYVPJqeBVV0B/hktpFtk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)