UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QyqZzddUDqTNoYLXl1Os/YWU7ykfMTje6pJAZyouRPY='
WHERE
key_id = '66ff435516861a65f11e7e04d3c3dea084a4cd57c2715d855c95cea0999f0be9'
AND (
token = 'QyqZzddUDqTNoYLXl1Os/YWU7ykfMTje6pJAZyouRPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)