UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yzg+x5zrsxRDIjTXRtWPdLkvj/hgqHBCO44G3gHR9zg=' 
WHERE 
  key_id = 'a200c5ea33f9197695bef87b949222bdd86ac1e219d9486a8d354c31dde5ef57' 
  AND (
    token = 'yzg+x5zrsxRDIjTXRtWPdLkvj/hgqHBCO44G3gHR9zg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025