UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rqunXG9P6psPINfXK7sAj9AhFCydSuK8XgPsJc7+oZ4='
WHERE
key_id = '4dcb93094531b7f03c2cbe0e0c1ac63fe34844362d0ae9ba9e68a065385596e2'
AND (
token = 'rqunXG9P6psPINfXK7sAj9AhFCydSuK8XgPsJc7+oZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)