UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's67U2pwNugTn4YXU8+Igy27wNBXw/frxFKpJPqcMa98='
WHERE
key_id = 'ff699b548d0f13f540c9d4fb7bfc5ec443ae6159c19b0383fd35833820355ba8'
AND (
token = 's67U2pwNugTn4YXU8+Igy27wNBXw/frxFKpJPqcMa98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)