UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7RySSCz+OdEsk1ynwvjYGHMeZQbR7uuMqPTTi+kZQqg='
WHERE
key_id = '067c02823a27aaae7ad5e313d0af35ba7ddc799a710b25fd9531831d2f03f087'
AND (
token = '7RySSCz+OdEsk1ynwvjYGHMeZQbR7uuMqPTTi+kZQqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)