UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MrHgsQypSx9cOFh0nczPsTM/8pYmIJbCvG1hMsQL5Dk='
WHERE
key_id = 'efb6f562e1b5583cf405c79661f380c3530d44afe07c72018513761acee1cd71'
AND (
token = 'MrHgsQypSx9cOFh0nczPsTM/8pYmIJbCvG1hMsQL5Dk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)