UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ypi2xFf3htU7GZa9KJj4gOiomjXMCc1oRT3ze5N5wg=' 
WHERE 
  key_id = '0c3cca7fceb57fbc162d5e6da652f2e2c519db9f733fc1af12cc8ac423bb5651' 
  AND (
    token = '0ypi2xFf3htU7GZa9KJj4gOiomjXMCc1oRT3ze5N5wg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041