UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k8WTWw4/gHvpcA/1L7rR72swAmalozKX1tZ8Omyu26I='
WHERE
key_id = '9315cc5409f0374011a96a38de605196bb256d17f9b1338e604558ed634e2558'
AND (
token = 'k8WTWw4/gHvpcA/1L7rR72swAmalozKX1tZ8Omyu26I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)