UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yJ0POvRXUow2OulwMWYVMxbRJJf+IjK9bWSlDbPeXeQ='
WHERE
key_id = '57bbc675f6161acf41539d1ca3fa85bdcc119623b5cfc66c01347862c9262705'
AND (
token = 'yJ0POvRXUow2OulwMWYVMxbRJJf+IjK9bWSlDbPeXeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)