UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nbSeXbd0P19emCRd5IjF8dA1xjmZJDWoV2MRFhPm3NY=' 
WHERE 
  key_id = 'a8da31a9637ab86edf8a6278bbef301022059eb40ef5f508e4e3b10f27b369f5' 
  AND (
    token = 'nbSeXbd0P19emCRd5IjF8dA1xjmZJDWoV2MRFhPm3NY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028