UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i4FDm/Zykdiun5JRvr2tM7gTYfYABnymQN9yKRNZ+ZI='
WHERE
key_id = '2f24a2a39df796f9e3b9a3f175b3d66267a5b2b90026be4f7dd8ec906e81bce4'
AND (
token = 'i4FDm/Zykdiun5JRvr2tM7gTYfYABnymQN9yKRNZ+ZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)