UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AsIqfCx8NLJo2ttMlIoMwfrHoLmVZNd19KzJ95fDcbU=' 
WHERE 
  key_id = '938b86a6fd230698db62920c4bd4ed3d6774110fc3c098f82bf9054c73b9b17b' 
  AND (
    token = 'AsIqfCx8NLJo2ttMlIoMwfrHoLmVZNd19KzJ95fDcbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036