UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pmw7+GlFGKTsMRSr75nZyIiO0J3zu5EdBjS9MlnbzNI=' 
WHERE 
  key_id = '8ad071cd64df494f8d691354c8e7563c4084fbb55a3097032ccba0bb4d759cb0' 
  AND (
    token = 'Pmw7+GlFGKTsMRSr75nZyIiO0J3zu5EdBjS9MlnbzNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027