UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pUFx09mGNZ6rqPJSgsDztZwbFIn1eRuZNofxzMb8eH0='
WHERE
key_id = '8899158f5cad71c1ec1fe4b292e6ac2736f8232d476be402caf9d55a56a1063d'
AND (
token = 'pUFx09mGNZ6rqPJSgsDztZwbFIn1eRuZNofxzMb8eH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)