UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DF66qy2vt/CSe+LjwF4jcaYMW3iGRrJfiPJDoDiBU+I=' 
WHERE 
  key_id = '292df327c12f6ca736f6458065f4b60d4ad898474027485506bd013370e3d7d2' 
  AND (
    token = 'DF66qy2vt/CSe+LjwF4jcaYMW3iGRrJfiPJDoDiBU+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047