UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zNKAALJCuKMwfK4ybFwUXW1dh1HR+gBHi8O6x0cLuDQ='
WHERE
key_id = '0c007b56a7ff599f174748e22e973148a361728d570fa56bd2d536c5c3a5247c'
AND (
token = 'zNKAALJCuKMwfK4ybFwUXW1dh1HR+gBHi8O6x0cLuDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)