UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SCX2lowhQapfRcK+NfKPFneTg1YT0I6Od7MDTwLYIok='
WHERE
key_id = '48324711f88d187792e8a646259e55a1239d3dd61d71577233c94cdfead03a02'
AND (
token = 'SCX2lowhQapfRcK+NfKPFneTg1YT0I6Od7MDTwLYIok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)