UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YS0tB+PXJr5Xmwa184UUfhjCYXhjtoXdqR3hCV/LJmM='
WHERE
key_id = '5720b0f7a211bbad103a6c0183b3d4d786241d1adb10a447f3b8991fb0e9ce9f'
AND (
token = 'YS0tB+PXJr5Xmwa184UUfhjCYXhjtoXdqR3hCV/LJmM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)