UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T+3W13a6RK+OlKVrDgA0B60poxBgXcMcaKWHM05f2+0=' 
WHERE 
  key_id = 'b7b6388263d92e28b917e4dfd2679406ed1c3e57421e944ed420ddf27fbc0f53' 
  AND (
    token = 'T+3W13a6RK+OlKVrDgA0B60poxBgXcMcaKWHM05f2+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044