UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nnzwguoHwOYRlQ1FVb70JnT+MbmZ1BzwFO7t5/n9dqg='
WHERE
key_id = '57a4b3ddaa39c4dde4be850544fcebb432193c42562748b6ecef8070f7aa7534'
AND (
token = 'nnzwguoHwOYRlQ1FVb70JnT+MbmZ1BzwFO7t5/n9dqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)