UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OhkShSf3GBkMTo6q8PkmhLerDyx7MCeejs4fNlEZUvM='
WHERE
key_id = 'e8ef8160817bcd6612a8b133b56fafe7d9e3c8a47f68558138c9deb04caeb62c'
AND (
token = 'OhkShSf3GBkMTo6q8PkmhLerDyx7MCeejs4fNlEZUvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)