UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8+YoCLzScnohy0SWglVIdzkeydvcH598JuLRYEq5PNg=' 
WHERE 
  key_id = '1c65164508cb4f67fcebc26fcec0c1489466d9a3fb5ba043c3c8c270db1fb9dc' 
  AND (
    token = '8+YoCLzScnohy0SWglVIdzkeydvcH598JuLRYEq5PNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045