UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/NtaWDejlrtVkklPAtB/jRj9+v+l8FByYIL1Bh+prn0='
WHERE
key_id = '1fd002a88e369426da72d5bb1335cbcbb458db90652ea3fd4d3a792865f61784'
AND (
token = '/NtaWDejlrtVkklPAtB/jRj9+v+l8FByYIL1Bh+prn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)