UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uXGRpVNlAOt5vNWfuqYbUr3dxg45yg38J6VhU/TGa6w='
WHERE
key_id = '380bf6bb420ca04aae181e570a33159b5506e20b88ac93dcb3e9aab74c25ea6f'
AND (
token = 'uXGRpVNlAOt5vNWfuqYbUr3dxg45yg38J6VhU/TGa6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)