UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3mCkhfwYyZf2BTkYyYVhbyhTJ/BzEWtHFgThTC8Wt1E=' 
WHERE 
  key_id = '212a61eedeb7b52c6a3ce461e1fbe167d85d2397e729cbd5580553027a33426a' 
  AND (
    token = '3mCkhfwYyZf2BTkYyYVhbyhTJ/BzEWtHFgThTC8Wt1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039