UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y6KAsWjLWXvsZhhh5njqRV5Ynz22/QFg6T3RISRD4hY=' 
WHERE 
  key_id = '8cc1095cb7b5346d38496fc3d1f559ada613d51c5887235b95447e709a1f0ea7' 
  AND (
    token = 'y6KAsWjLWXvsZhhh5njqRV5Ynz22/QFg6T3RISRD4hY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024