UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jSeDfWj8MpzXGHRc/ba2tSMx2Q4Dd2qHY7aHmG/cvII='
WHERE
key_id = '524be4f82ead4e8bd54bd06744a8e60e654b0e0e21cc13a126038ab9fd08ef3f'
AND (
token = 'jSeDfWj8MpzXGHRc/ba2tSMx2Q4Dd2qHY7aHmG/cvII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)