UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RVYNdWP794jbHZF3nL4jrg2UpeHLXH+zWdS5r9N/WBM=' 
WHERE 
  key_id = 'a0d9d6398ba1a5b2870f7183a339ccb6b35899da24908ef8b4f4ff6c8b9301e5' 
  AND (
    token = 'RVYNdWP794jbHZF3nL4jrg2UpeHLXH+zWdS5r9N/WBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037