UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BUd2LXiMFmvRyk2ooQDpEVmTDWpSXanUmP85DsaPWts='
WHERE
key_id = 'cd939419781e4007593618a7a5b49db248ff51a076eca4febc87190eb695b815'
AND (
token = 'BUd2LXiMFmvRyk2ooQDpEVmTDWpSXanUmP85DsaPWts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)