UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R+mH3tPDFy4UAi6MtYlKGQOP2+40d57PvmUPYn/q2DY=' 
WHERE 
  key_id = '33b72ceea2319e47c4fbd3d3b7d3117296f4a8a94a846b2bc649849a4ae3f633' 
  AND (
    token = 'R+mH3tPDFy4UAi6MtYlKGQOP2+40d57PvmUPYn/q2DY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035